{% extends "base.html" %}

{% block breadcrumb_current %}
    超级管理员 > 新增管理员所在部门
{% endblock %}

{% block content %}
<div class="container" style="margin-top: 50px;">
    <!-- 消息提示 -->
    {% if messages %}
        {% for message in messages %}
            <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                {{ message }}
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        {% endfor %}
    {% endif %}

    <form method="POST" novalidate>
        {% csrf_token %}
        
        <div class="form-section">
            <h4 class="mb-3">县区信息</h4>
            <div class="row">
                <div class="col-md-6 mb-3">
                    <label for="{{ form.department.id_for_label }}" class="form-label required">县区名称</label>
                    {{ form.department }}
                    {% if form.department.errors %}
                        <div class="invalid-feedback">{{ form.department.errors|join:", " }}</div>
                    {% endif %}
                </div>

                <div class="col-md-6 mb-3">
                    <label for="{{ form.company.id_for_label }}" class="form-label required">所属地市</label>
                    {{ form.company }}
                    {% if form.company.errors %}
                        <div class="invalid-feedback">{{ form.company.errors|join:", " }}</div>
                    {% endif %}
                </div>
            </div>
        </div>
        
        <div class="row" style="margin-top: 40px;">
            <div class="col-md-12 text-center">
                <a href="{% url 'navigation' %}" class="btn btn-secondary">取消</a>
                <button type="submit" class="btn btn-primary ms-2">保存</button>
            </div>
        </div>
    </form>
</div>
{% endblock %}